package com.yycx.module.bus.client.entity.hy;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yycx.common.mybatis.annotation.TableAlias;
import com.yycx.common.mybatis.base.entity.AbstractEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;
import com.yycx.common.mybatis.annotation.TableAlias;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 非两票订单明细
 *
 * @author flyme
 * @date 2022-11-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("bus_hyorder_detail")
@TableAlias("bhd")
@ApiModel(value = "BusHyorderDetail对象", description = "非两票订单明细")
public class HyOrderDetail extends AbstractEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "orderDetailsId", type = IdType.ASSIGN_ID)
    private String orderDetailsId;

    @ApiModelProperty(value = "订单Id")
    private String orderId;

    @ApiModelProperty(value = "父ID")
    private String parentId;

    /**
     * 部门ID
     */
    private Long deptId;

    @ApiModelProperty(value = "业务员ID")
    private Long saleManId;

    @ApiModelProperty(value = "业务员唯一编码")
    private String saleManCode;

    @ApiModelProperty(value = "渠道商ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdF;

    @ApiModelProperty(value = "片区服务商")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdC;

    @ApiModelProperty(value = "商务经理")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdD;

    @ApiModelProperty(value = "商务总负责人")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long saleManIdE;

    @ApiModelProperty(value = "部门总监")
    private Long deptManagerId;

    @ApiModelProperty(value = "商品ID")
    private Long drugsId;


    @ApiModelProperty(value = "商品编号")
    private String drugNo;

    @ApiModelProperty(value = "结算政策ID")
    private Long policyDrugId;


    @ApiModelProperty(value = "商品名称")
    private String drugsName;

    @ApiModelProperty(value = "规格")
    private String drugsSpec;


    @ApiModelProperty(value = "商品类型")
    private String drugType;


    @ApiModelProperty(value = "件容")
    private Integer drugJr;

    @ApiModelProperty(value = "件数")
    private BigDecimal drugJs;

    @ApiModelProperty(value = "打印件数")
    private BigDecimal printDrugJs;

    @ApiModelProperty(value = "身份编码")
    private String orderCode;

    @ApiModelProperty(value = "批号")
    private String drugLotNo;

    @ApiModelProperty(value = "库存编号")
    private Integer drugLotId;

    @ApiModelProperty(value = "仓库编码")
    private String storeCode;

    @ApiModelProperty(value = "仓库名称")
    private String storeName;

    @ApiModelProperty(value = "发票号码")
    private String invoiceNo;

    @ApiModelProperty(value = "账套ID")
    private Long companyId;

    @ApiModelProperty(value = "机构ID")
    private Long organizationId;

    @ApiModelProperty(value = "生产厂家")
    private String producersName;


    @ApiModelProperty(value = "销售价格(含税单价)")
    private BigDecimal salePrice;

    @ApiModelProperty(value = "销售金额")
    private BigDecimal saleAmount;


    @ApiModelProperty(value = "数量")
    private BigDecimal saleNum;

    @ApiModelProperty(value = "剩余库存")
    private BigDecimal surplusNum;

    @ApiModelProperty(value = "发货金额")
    private BigDecimal deliveryPrice;

    @ApiModelProperty(value = "成本价格")
    private BigDecimal costPrice;

    @ApiModelProperty(value = "成本金额")
    private BigDecimal costAmount;

    /**
     * 区域ID
     */
    private Long areaId;


    @ApiModelProperty(value = "结算发货金额")
    private BigDecimal settleSendAmount;

    @ApiModelProperty(value = "预收款")
    private BigDecimal customYsk;



    /**
     * 回款认款状态(0:未认款,1:已认款)
     */
    private Integer customReturnState;


    @ApiModelProperty(value = "发(退)货日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date sendDate;

    @ApiModelProperty(value = "销售年度")
    private Integer sendYear;
    @ApiModelProperty(value = "销售月份")
    private Integer sendMonth;
    @ApiModelProperty(value = "销售日期")
    private Integer sendDay;


    @ApiModelProperty(value = "货款结余金额")
    private BigDecimal productBalanceAmount;

    @ApiModelProperty(value = "票折价")
    private BigDecimal discountPrice;


    @ApiModelProperty(value = "税率差额")
    private BigDecimal taxRateDiff;

    @ApiModelProperty(value = "税率差额公式")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String taxRateDiffFormula;

    @ApiModelProperty(value = "超期差额")
    private BigDecimal overDateAmount;

    @ApiModelProperty(value = "超标准差额")
    private BigDecimal overStandAmount;

    @ApiModelProperty(value = "利润")
    private BigDecimal profitAmount;

    @ApiModelProperty(value = "税收利润")
    private BigDecimal taxProfitAmount;

    @ApiModelProperty(value = "产品利润")
    private BigDecimal drugProfitAmount;

    @ApiModelProperty(value = "边际利润")
    private BigDecimal bjProfitAmount;

    /**
     * 校验金额
     */
    private BigDecimal checkAmount;

    /**
     * 支付开票税金(预估)
     */
    private BigDecimal payInvoiceTaxAmount;
    /**
     * 预提税金
     */
    private BigDecimal ytTaxAmount;

    @ApiModelProperty(value = "底价方式")
    private Integer floorPriceType;


    @ApiModelProperty(value = "资保金底价")
    private BigDecimal customFloorAmount;

    @ApiModelProperty(value = "底价公式")
    private String customFloorAmountFormula;

    @ApiModelProperty(value = "资保金高开税金")
    private BigDecimal customGapUpAmount;

    @ApiModelProperty(value = "资保应收金金额")
    private BigDecimal customBond;

    /**
     * 资保金实际收款金额
     */
    private BigDecimal customBondTakeAmount;

    /**
     * 资保金收款银行
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String customBondBankName;

    /**
     * 资保金收款账户
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String customBondBankNo;

    /**
     * 资保金收款日期
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date customBondDate;

    /**
     * 资保金状态(0:未退款 1:已认款 2 已退款)
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Integer customBondState;

    /**
     * 保证金退款日期
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date customBondRetDate;


    /**
     * 保证金退款金额
     */
    private BigDecimal customBondRetAmount;

    /**
     * 保证金退款账户
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String customBondRetBankNo;

    /**
     * 保证金退款银行
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String customBondRetBankName;


    /**
     * 退保证金id
     */
    private Long refundBondId;


    @ApiModelProperty(value = "购货方保证金税金金额")
    private BigDecimal customGapUpTaxesAmount;


    /**
     * 利润公式
     */
    private String profitAmountFormulaContent;

    /**
     * 销售类型
     */
    private String saleType;

    @ApiModelProperty(value = "发货方式")
    private Integer sendType;

    /**
     * 客户编号
     */
    private String customCode;


    /**
     * 购货方ID
     */
    private Long customId;
    /**
     * 比例
     */
    private BigDecimal radio;

    /**
     * 状态
     */
    private Integer orderDetailsState;

    /**
     * 包票
     */
    private Integer baopiao;


    /**
     * 结算规则(1:回款后结算,0:不回款结算)
     */
    private Integer settleRule;

    /**
     * 部门结算价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal deptPrice;

    /**
     * 部门结算税率
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal deptRate;

    @ApiModelProperty(value = "部门结算金额")
    private BigDecimal deptSettleAmount;


    /**
     * 渠道商结算方式(1：按结算价 2:佣金制)
     */
    private Integer settleAmountType;


    /**
     * 部门结算公式内容
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String deptSettleFormula;


    /**
     * 部门利润公式内容
     */
    private String deptProfitAmountFormula;


    /**
     * 部门利润
     */
    private BigDecimal deptProfitAmount;

    /**
     * 部门利润付款日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date deptProfitAmountPayDate;

    /**
     * 高开费率
     */
    private BigDecimal customSettleGapUpTaxRate;


    /**
     * 渠道商结算单价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settlePrice;

    /**
     * 渠道商结算每盒提成单价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal rebateAmount;

    /**
     * 渠道商结算提成金额
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleRebateAmount;

    /**
     * 渠道商结算金额
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleAmount;

    /**
     * 渠道商结算费率
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleRate;


    /**
     * 渠道商结算提成公式
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String rebateSettleFormula;


    /**
     * 渠道商结算公式内容
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String settleFormulaContent;


    /**
     * 商务经理结算单价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settlePriceD;

    /**
     * 最高加价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal makeUpPriceD;


    /**
     * 商务经理结算单价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleAmountD;


    /**
     * 商务经理结算费率
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleRateD;

    /**
     * 商务经理结算公式内容
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String settleFormulaContentD;

    /**
     * 片区服务商结算单价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settlePriceC;


    /**
     * 片区服务商结算单价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleAmountC;


    /**
     * 片区服务商结算费率
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleRateC;

    /**
     * 片区服务商结算公式内容
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String settleFormulaContentC;


    /**
     * 商务总负责人结算单价
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settlePriceE;


    /**
     * 商务总负责人结算金额
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleAmountE;


    /**
     * 商务总负责人结算费率
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal settleRateE;

    /**
     * 商务总负责人结算公式内容
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String settleFormulaContentE;




    /**
     * 创建订单的主机名称
     */
    private String hostName;

    @ApiModelProperty(value = "核算状态0:未核算 1:已核算")
    private Integer calculateState;

    /**
     * 有效期至
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date expirationDate;


    /**
     * 生成日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date generationDate;

    @ApiModelProperty(value = "退货原因")
    private String reason;


    @ApiModelProperty(value = "自定义政策")
    private Integer customPolicy;

    @ApiModelProperty(value = "自定义政策描述")
    private String policyRemark;

    /**
     * 打印时合并行数
     */
    @TableField(exist = false)
    private Integer rowspan;


    /**
     * 拆分剩余金额
     */
    @TableField(exist = false)
    private BigDecimal surplusAmount;

    @ApiModelProperty(value = "商品标签打印状态")
    private Integer outPrintTag;


    /**
     * 回款银行
     */
    @TableField(exist = false,updateStrategy = FieldStrategy.IGNORED)
    private String returnBank;

    /**
     * 回款银行账户
     */
    @TableField(exist = false,updateStrategy = FieldStrategy.IGNORED)
    private String returnBankNo;

    @ApiModelProperty(value = "回款日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false,updateStrategy = FieldStrategy.IGNORED)
    private Date returnDate;

    /**
     * 认款日期
     */
    @TableField(exist = false,updateStrategy = FieldStrategy.IGNORED)
    private String renkuanDate;

    @ApiModelProperty(value = "回款金额")
    @TableField(exist = false,updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal returnAmount;


}
